# -*- coding:utf-8 -*-
# Author:Ami
# @Time    : 2018/12/15 10:24

import threading, time


def run(n):
    print("task", n)
    time.sleep(2)


start_time = time.time()
t_objs = []
for i in range(50):
    t = threading.Thread(target=run, args=("t%s" % i,))
    t.start()
    t_objs.append(t)

for t in t_objs:
    t.join()

print("-------------", threading.current_thread(), threading.active_count())
print("cost:", time.time() - start_time)
# run(1)
# run(2)
